<?php
declare(strict_types=1);
// 购物车
namespace app\tjy_v1\controller;
class Cart
{
    // 购物车列表
    public function List()
    {
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "购物车列表",
            "db" => [
                "items" => [
                    "type" => "items",
                    "data" => [
                        "list" => [
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/139220/40/17156/149715/5fcd845dEd0b7fa22/d5d02cb4d8e3d134.jpg",
                                "goods_id" => "153546481082105856",
                                "goods_name" => "两件套套装裙连衣裙春季女装新款内搭套头针织衫毛衣中长款打底裙",
                                "shop_price" => "199.00",
                                "final_price" => "199.00",
                                "is_invalid" => 0,//失效商品
                                "integral" => 1,//积分
                                "goods_price" => 1,//单价金额
                                "goods_number" => 1,//商品数量
                                "goods_sku_text" => "商品库存信息",//商品库存信息
                                "goods_sku_key" => "gfgsdfgdg",//商品库存信息键
                                "is_checked" => 1,//是否选中
                                "sale_status" => 0,//下架
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/144284/24/17256/147050/5fcdfddeEfaefd541/4f22bbc129c312f3.jpg",
                                "goods_id" => "153601245093138434",
                                "goods_name" => "小熊（Bear）电火锅分体式电煮锅多功能电热锅宿舍锅4L电炒锅多用途锅DHG-P40F2",
                                "shop_price" => "149.00",
                                "final_price" => "149.00",
                                "is_invalid" => 1,//失效商品
                                "integral" => 1,//积分
                                "goods_price" => 1,//单价金额
                                "goods_number" => 1,//商品数量
                                "sale_status" => 0,//已下架
                                "goods_sku_text" => 0,//商品库存
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/156168/40/7900/148247/60135a66E25dfddf9/cfa73c385c5ed75a.jpg",
                                "goods_id" => "154338107942731778",
                                "goods_name" => "禧美 国产大虾 净重1.8kg 90-108只/盒 对虾 烧烤 火锅 生鲜 海鲜水产",
                                "shop_price" => "126.00",
                                "final_price" => "126.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/44899/31/4928/223659/5d2a7c8fE46b882ba/8ee4f1a11d6b0f64.jpg",
                                "goods_id" => "155103827952750594",
                                "goods_name" => "短袖t恤男夏季纯白色韩版男士纯色圆领半袖体恤打底衫潮流半截袖夏装修身棉弹力上衣",
                                "shop_price" => "58.00",
                                "final_price" => "58.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t23884/24/36497449/456723/81bd9800/5b236267N095864e2.jpg",
                                "goods_id" => "155832710212702210",
                                "goods_name" => "西子映香 真丝丝巾女桑蚕丝杭州丝绸高档真丝围巾女士印花大方巾职场围脖披肩围巾送礼母亲妈妈款",
                                "shop_price" => "298.00",
                                "final_price" => "298.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/130863/13/16133/123291/5fb204e5E6ffdc61a/f5805cfbf1cdf8fc.jpg",
                                "goods_id" => "156567141409681410",
                                "goods_name" => "裙钗记包芯纱秋冬韩版宽松V领毛衣女大码针织衫女打底衫长袖上衣",
                                "shop_price" => "39.00",
                                "final_price" => "39.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/152489/36/11317/77794/5fe43fa3Eaa0ba8c9/631f32bb27cb0c75.jpg",
                                "goods_id" => "156758231248773122",
                                "goods_name" => "ThinkPadThinkBook 14",
                                "shop_price" => "5199.00",
                                "final_price" => "5199.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/160606/37/11132/439954/604643c0E543e9aff/46473f8294f7072a.png",
                                "goods_id" => "157151837003517954",
                                "goods_name" => "华硕（ASUS）VivoBook15s/15 十代英特尔酷睿 15.6英寸轻薄笔记本电脑",
                                "shop_price" => "4189.00",
                                "final_price" => "4189.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/168288/34/8135/79735/60373b86Eb793b295/596817183ac077e0.jpg",
                                "goods_id" => "157166433979977730",
                                "goods_name" => "联想(Lenovo)YOGA 14s 英特尔Evo平台14英寸全面屏超轻薄笔记本电脑",
                                "shop_price" => "5928.00",
                                "final_price" => "5928.00"
                            ],
                            [
                                "goods_image" => "https://img14.360buyimg.com/n1/s800x800_jfs/t1/108888/4/7920/186317/5e61dbd5E1a440477/dfcf0cc3456126f4.jpg",
                                "goods_id" => "157168206114168834",
                                "goods_name" => "南极人情侣睡衣男士睡衣女冰丝仿真丝绸秋冬季长袖开衫女士家居服套装衬衫式衣裤两件套居家服仙鹤国风潮款",
                                "shop_price" => "119.00",
                                "final_price" => "119.00"
                            ]
                        ],
                        "total" => 15
                    ]
                ],
                "submit" => [
                    "type" => "submit",
                    "data" => [
                        "field" => [
                            "note" => "结算金额备注",//结算金额备注
                            "is_all_checked" => 0,//全选是否选中0否
                            "is_can_submit" => 1,//结算按钮可点击0不可
                            "total_price" => "485.00",//订单原始结算金额
                            "total_goods" => 440,//结算金额
                        ],
                        "style" => [
                            "background" => "#d81e06",//结算按钮颜色
                            "fontSize" => 40
                        ]
                    ],
                    "show" => 1//结算按钮块是否显示
                ]
            ]
        ];
        return json($apidb);
    }
    // 购物车商品删除
    public function del()
    {
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "购物车商品删除",
        ];
        return json($apidb);
    }
    // 购物车商品信息更新
    public function up()
    {
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "购物车商品信息更新",
        ];
        return json($apidb);
    }
    // 购物车列表全选
    public function SelectAll()
    {
        $apidb = [
            'code' => 200,
            'time' => time(),
            'cache' => cache("我是谁"),
            'msg' => "购物车列表全选",
        ];
        return json($apidb);
    }
}
